import App from "./App";

// #ifndef VUE3
import Vue from "vue";
Vue.config.productionTip = false;
App.mpType = "app";
import store from "./store";
import uView from "@/uni_modules/uview-ui";
Vue.use(uView);

import BaseMixin from "@/mixins/base.js";
Vue.mixin(BaseMixin);
import Cache from "./utils/cache";

Vue.prototype.$Cache = Cache;
Vue.prototype.$yuming = "http://admin.jichacha.vip";
Vue.prototype.$session_id =
  uni.getStorageSync("session_id") ||
  (function () {
    var session_id =
      new Date().getTime() + Math.floor(Math.random() * (9 - 0) + 0); //13位数的毫秒 + 随机数
    uni.setStorage({ key: "session_id", data: session_id }); //异步接口
    return session_id;
  })();
const app = new Vue({
  ...App,
  store,
});
app.$mount();

// #endif

// #ifdef VUE3
import { createSSRApp } from "vue";
export function createApp() {
  const app = createSSRApp(App);
  return {
    app,
  };
}
// #endif
